<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div class="span9">
		<c:forEach var="book" items="${requestScope.pageBean.data }">
				<div class="row-fluid">
					<div class="span2">
						<!-- 这里不加“/”用的是相对路径，“/”代表的是webContent所在的当前路径，即相对的是webContent所在的当前路径 -->
						<br /> <img src="assets/app/bookpic/${book.pic}" width="160" height="160" />
					</div>
					<div class="span8">
						<h5>${book.name }</h5>
						<ul class="unstyled">
							<li>作 者:${book.author}</li>
							<li>出 版社:${book.publisher }</li>
							<li>出版时间:
								<fmt:formatDate value="${book.publishDate }" pattern="yyyy年-MM月"/>
							</li>
							<li>价 格:￥
								<fmt:formatNumber value="${book.price }" pattern="0.00"/>
							</li>
						</ul>
						<h3>
							<a href="cart.do?m=addCart&bId=${book.id}" class="btn btn-warning">
							<i class="icon-shopping-cart icon-white"></i>
								加入购物车
							</a>
						</h3>
					</div>
				</div>
		<hr />
	</c:forEach>
		
		<div class="pagination pull-right">
			<ul>
				<li>
					<c:if test="${requestScope.pageBean.pageIndex<=1}">
						<a class="disabled">上一页</a>
					</c:if>
					<c:if test="${requestScope.pageBean.pageIndex>1}">
					<!-- 范围名称可以不用写 ，这里&i=${pb.index-1},因为是上一页，所以减1-->
						<a href="home.do?cId=${requestScope.catalogId}
						&i=${requestScope.pageBean.pageIndex-1}
						&s=${requestScope.pageBean.pageSize}">
							上一页
						</a>
					</c:if>
				</li>
			
			
			<!-- 这个要进行修改， bootstrap的局限性，样式已经写好，不好更改-->
			<!-- 循环每一页【第一页，第二页。。。。。】 -->
			<c:forEach var="j" begin="1" end="${requestScope.pageBean.totalPage }" >	
				<li class="${requestScope.pageBean.pageIndex==j ? 'active' : 'disabled'}">
					<a href="home.do?cId=${requestScope.catalogId }
					&i=${j}
					&s=${requestScope.pageBean.pageSize}">
						${j}
					</a>
				</li>
			</c:forEach>
			
				<li>
					<c:if test="${requestScope.pageBean.pageIndex >= requestScope.pageBean.totalPage }">
						<a class="disabled">下一页</a>
					</c:if>
					<c:if test="${requestScope.pageBean.pageIndex < requestScope.pageBean.totalPage}">
						<a href="home.do?cId=${requestScope.catalogId }
						&i=${requestScope.pageBean.pageIndex+1}
						&s=${requestScope.pageBean.pageSize}">
							下一页
						</a>
					</c:if>
				</li>
			</ul>
			<span >共计${requestScope.pageBean.total}条记录</span>
		</div>
	</div>
</body>
</html>